The invention pertains to the field of performance enhancing devices for CD-ROM devices and other slow access memory devices.
CD-ROM devices, and other devices like magneto-optical disk drives and tape drives are notoriously slow in accessing data. For example, in so called 1xc3x97CD-ROM devices typical access times are 390 milliseconds (hereafter msec) and data transfer rates are typically 150 kilobytes/second (hereafter KB/sec). Even so called 2xc3x97CD-ROM drives are not much faster, averaging 200-290 msec access times and 300 KB/sec transfer rates, and 4xc3x97devices average 190 msec access time and 600 KB/sec transfer rates.
In an attempt to alleviate this problem, manufacturers of CD-ROM devices have been incorporating random access memory into their devices to help speed up access. The random access memory is managed as a cache. Typical cache sizes of up to 256 kilobytes of random access memory have been used. The probem with this approach is that the capacity for data storage in CD-ROM devices is so huge, that a 256 kilobyte (hereafter KB) cache does not significantly speed up access. For example, typical data transfer rates for a 1xc3x97CD-ROM with a 256 KB cache are only speeded up to 170-180 KB/sec and 4xc3x97device have their data transfer rates speeded up to only 700 KB/sec.
In another approach to solving this problem, some manufacturers such as Insignia Software Solutions, with its RapidCD software product, have introduced drivers for CD ROM devices which use the hard disk and RAM of the host computer as look-ahead cache memory. Another example of this type of product is the CD-ROM Toolkit by FWB Software, Inc. The problem with this approach (which will be called the software cache approach herein) is that using part of the host hard disk and RAM for cache purposes for the CD-ROM device lowers the capacity of the host hard disk and RAM for other purposes such as storing application programs and data. In many cases, especially where a multitasking environment is in effect such as in Windows and Macintosh environments, the remaining space on the host hard disk and RAM is insufficient to support all necessary operations. Further, although a program may initially run, it may ultimately crash as more demands on the host RAM and hard disk for storage are made. This can lead to loss of whatever data is currently displayed which has not yet been saved to hard disk.
The software cache approach also requires that the host CPU be used to manage the cache such as reading the least recently used table, storing data into the cache, intercepting read requests and examining the cache map and extracting data from the software cache or from the CD-ROM as appropriate.
The software cache approach also utilizes the file operating system of the host. Typically, such operating system functions require a fairly large amount of overhead even for a simple data transfer.
Also, software cache operation is not universally compatible with all operating systems and hardware platforms.
The software cache approach is also not terribly efficient, because to store data in the host hard disk cache area, the data is first transferred from the CD-ROM into the host RAM, and from there into the host hard disk cache area. This two step process involves overhead for each of the two storage transactions and ties up the host CPU, the host RAM and the host hard disk thereby precluding these assets from being used for other multitasking purposes during the transactions.
Accordingly, a need has arisen for a method and apparatus to vastly speed up access times and data transfer rates for slow access time rotating media bulk storage memory devices which solves the above noted problems and is completely transparent to the host computer.
According to the teachings of the invention, there is disclosed herein a controller for a slow access time rotating media bulk storage memory devices such as a CD-ROM drive or magneto-optical read/write drive which uses a conventional large-capacity, rotating-magnetic-media type hard disk as a cache.
The bulk memory storage device controller system comprises the following elements in combination. A first bus controller for the rotating media bulk storage memory device is located within the controller and is coupled to an external rotating media bulk storage memory device via a first bus and a first bus port. In some embodiments, the rotating media bulk storage memory device may be integrated within the same housing which contains the bulk memory storage device controller system. Typically, the rotating media bulk storage memory device is coupled to the first bus controller by a SCSI bus but the bus can be any known bus or any bus developed in the future. The first bus controller serves to manage data transfers to and from said rotating media bulk storage memory device in the manner said data transfers are normally accomplished over the first bus.
A second bus controller is located within the controller system and is coupled to a second bus port. A conventional large-capacity, rotating-magnetic-media type hard disk is coupled to the second bus controller via the second bus port and a second bus. This conventional large-capacity, rotating-magnetic-media type hard disk may be integrated within the bulk memory storage device controller system or may be external to it.
A third bus controller is located within the controller system and is coupled to a third bus port. A conventional host computer such as a PC, Macintosh etc. is coupled to the third bus controller via the third bus port. The function of the third bus controller is to control data transfers back and forth between the host computer and the controller system via the third bus and to present to the host computer a conventional CD-ROM etc. interface. That is, if the bulk storage device is a CD-ROM, the third bus controller serves to present a conventional CD-ROM interface to the host computer such that the fact that a hard disk cache is used is transparent to the host computer in the sense that the CD-ROM driver software need not include any instructions or commands that accomodate the presence of the hard disk cache. To the host computer CD-ROM driver software, the controller system according to the invention looks simply like a CD-ROM drive except it is faster.
A memory within the system controller stores program instructions and data needed by the microprocessor to be described next. In most embodiments, the program instructions are stored in non-volatile memory such as EPROM, and the data is stord in volatile static RAM. In alternative embodiments, the program may be stored on the conventional rotating-magnetic-media type hard disk and read out and stored in the RAM at power-up.
A microprocessor is coupled to the memory and the first, second and third bus controllers via data, control and address buses and serves to execute the program instructions stored in the memory. The program controls the microprocessor to manage the controller system such that the conventional rotating-magnetic-media type hard disk implements a cache memory function for the conventional rotating media bulk storage memory device. The program controls the microprocessor to copy at least some of the data from said rotating media bulk storage memory device to said conventional rotating-magnetic-media type hard disk whenever a new rotating media is inserted into said rotating media bulk storage memory device. The program also controls the microprocessor to keep a record in said memory of what blocks of data from said rotating media bulk storage memory device have been stored in said rotating-magnetic-media type hard disk and the addresses thereof in the rotating-magnetic-media type hard disk. In the preferred embodiment, the hard disk cache has one area devoted to cloning, i.e., making a duplicate of all or some subset of the blocks of data on a CD-ROM disk, and has another area managed as a cache memory. In such an embodiment, there is a clone map which consists of approximately 1400 bytes in a table (big enough to clone an entire CD-ROM disk), each bit of which maps to one page of data on the CD-ROM disk. When the bit is on, the corresponding page is stored in the clone area of the hard disk. Another table is stored in RAM as a cache map. The cache map contains data indicating which pages of data from the CD-ROM disk are stored on the hard disk and the recency of use of each page stored in the hard disk cache area. The program also controls the microprocessor to intercept read requests from the host computer, and, if the requested data has previously been stored in the rotating-magnetic-media type hard disk, the requested data is retrieved from said rotating-magnetic-media type hard disk and transmitted to host computer. If, however, the requested data has not been previously stored in the rotating-magnetic-media type hard disk, the requested data is retrieved from said rotating media bulk storage memory device and transmitted to said host computer. The program also controls the microprocessor so as to cause the data just retrieved from the rotating media bulk storage memory device to be stored in said rotating-magnetic-media type hard disk. The cache map, i.e., the record stored in the memory of what data is stored in the rotating-magnetic-media type hard disk is then updated by the microprocessor to reflect the fact that new data has been stored in the rotating-magnetic-media type hard disk and the address or addresses thereof in said rotating-magnetic-media type hard disk are recorded. In the preferred embodiment, the cache map (and clone area map in some embodiments) are periodically copied to the hard disk 22 as a back-up in case of power failure or normal shutdown. In some embodiments, this backup process can be performed each time the cache map or clone map is updated. Where this causes too much overhead however, the backup process to the hard disk can be performed less frequently such as every four times the cache area map is updated and every four updates of the clone area map during the cloning process to fill up the clone area of the hard disk.
In the preferred embodiment, an indication is kept in the cache map of the recency of use of various blocks of data stored in the rotating-magnetic-media type hard disk. This allows flushing of enough least recently used data to make room for a whole new page of data whenever a read request is received for a block of data not currently stored in the rotating-magnetic-media type hard disk cache. Then, when a read request for a block of data not currently stored in the cache is received, the whole page on which the requested data is stored is copied to the cache. When the requested data has been read, it is transmitted to the host computer and subsequent blocks on the same page are continuously copied to the cache until the entire page has been copied to the cache.
In the preferred embodiment, a direct-memory-access bus is also used coupling the first, second and third bus controllers to each other. This allows any of the first, second or third controllers to transfer data directly to one another without the involvement of said microprocessor thereby speeding up transfers of data. In the preferred embodiment, a data transceiver is also used coupling the data bus to the direct-memory-access bus thereby providing a data path by which said first, second or third bus controllers can transmit data on said data bus to the microprocessor, and the microprocessor can transmit data on said direct-memory-access bus into the buffer memories of the controllers.
In the preferred embodiment, the program controls the microprocessor to intercept eject commands thereby determining when the rotating media has been ejected and replaced with another rotating media. When such an event occurs, the microprocessor checks whether the new rotating media is the same rotating media as previously was present and which previously had at least some of its data copied to said rotating-magnetic-media type hard disk. This is done by checking data from the beginning, midde and end tracks of the new rotating media against the corresponding locations, if any, in the rotating-magnetic-media hard disk type device as reflected in the cache map. If the data matches, the new rotating media is assumed to be the same rotating media as was previously present, and no new data copying process is initiated. If there is no match, the new rotating media is assumed to be a different rotating media. In this case, the program controls the microprocessor to initiate the process of copying at least some of the data stored thereon to the rotating-magnetic-media type hard disk such that the data stored in the rotating-magnetic-media type hard disk acting as a cache memory matches at least some of the data stored on said rotating media bulk storage memory device.
In the preferred embodiment, the process of cloning the most recently used part of the CD-ROM to one part of the dedicated hard disk and caching parts of the CD-ROM to another part of the hard disk utilizes a xe2x80x9cstripingxe2x80x9d storage scheme so that the entire CD-ROM does not have to be read. In this scheme, during the cloning process or during the initial filling of the cache area, the system controller reads an initial 128 kbyte block from the CD-ROM and stores it to the hard disk clone area. Then, the next 64 kbyte block is skipped and not copied to the hard disk. Next, the next sequential 128 kbyte block following the skipped 64 kbyte block is read from the CD-ROM and stored to the hard disk. This process is continued until the entire clone area of the hard disk is filled. Then the process is repeated for the cache area of the dedicated hard disk.
When a read request from the host occurs which spans blocks on the CD-ROM which have been copied to the hard disk and blocks that have not, simultaneous commands are sent by the cache controller to the dedicated hard disk and the CD-ROM so that both can start their seek movements simultaneously. If the hard disk blocks are first, they are sent to the host. While this is happening, the CD-ROM gets its data and stores it in its own dedicated RAM cache. After the transfer from the dedicated hard disk is complete, the data retrieved from the CD-ROM is retrieved from the CD-ROM""s dedicated RAM cache and sent to the host computer. This way, all data read is read from fast sources in a way that is transparent to the host.
The advantages of the invention are that it does not utilize any of the host computer""s hardware or processing capacity thereby preserving these assets for use in the multitasking environment. All the processing power needed to manage the cache function is performed by a dedicated microprocessor in the cache controller, and the bulk storage needed is provided by a dedicated hard disk. The invention reduces the time needed to cache 100% of the CD-ROM since there is no operating system overhead. Further, compatibility among all operating systems and hardware platforms is assured since the cache function is entirely transparent to the host. In other words, the host does not have to have any built in dependencies on the pecularities of the cache system and all it needs to do is issue a standard read request as if the only hardware to which it was connected is a standard CD-ROM drive. Further, there is no bottleneck created as is the case with the I/O channel to the CD-ROM in the software cache approach since all data transfers involved in the cache operating are by DMA channels within the cache controller which is external to the host.